<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        var a=[7,6,5,4,3,2,1];
        var b="";
        for(var k=0;k<=a.length-1;k++)
        {
        for(var i=0;i<=a.length-1;i++)
        {
            if(a[i]>a[i+1])
            {
            b=a[i];
            a[i]=a[i+1];
            a[i+1]=b;
            }
          }
        }
        console.log("数组从小到大排序："+a);
    </script>
    <p align="center"> &copy; 版权由一诺必成归属，未经允许不得复制、镜像</p>
</body>
</html>